package com.zyh.kaoshi.test1.domain;

/**
 * @Author zyh
 * @Date 2024/8/3 12:05
 * @Description Dog 类
 */

public class Dog{
    private String name;
    private String breed;
    private Integer healthValue;

    public Dog() {
    }

    public Dog(String name, String breed, Integer healthValue) {
        this.name = name;
        this.breed = breed;
        this.healthValue = healthValue;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getBreed() {
        return breed;
    }

    public void setBreed(String breed) {
        this.breed = breed;
    }

    public Integer getHealthValue() {
        return healthValue;
    }

    public void setHealthValue(Integer healthValue) {
        this.healthValue = healthValue;
    }

    @Override
    public String toString() {
        return "Dog{" +
                "name='" + name + '\'' +
                ", breed='" + breed + '\'' +
                ", healthValue=" + healthValue +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Dog dog = (Dog) o;

        if (name != null ? !name.equals(dog.name) : dog.name != null) return false;
        if (breed != null ? !breed.equals(dog.breed) : dog.breed != null) return false;
        return healthValue != null ? healthValue.equals(dog.healthValue) : dog.healthValue == null;
    }

    @Override
    public int hashCode() {
        int result = name != null ? name.hashCode() : 0;
        result = 31 * result + (breed != null ? breed.hashCode() : 0);
        result = 31 * result + (healthValue != null ? healthValue.hashCode() : 0);
        return result;
    }
}
